<%@page import="br.com.Modelo.UsuarioCliente"%>
<<<<<<< .mine
<%@page import="br.com.Modelo.UsuarioComerciante"%>
<%@page import="br.com.Dao.UsuarioClienteDao"%>
<%@page import="br.com.Dao.UsuarioComercianteDao"%>
=======
<%@page import="br.com.Modelo.UsuarioComerciante"%>
>>>>>>> .r21
<%@page import="br.com.Dao.UsuarioClienteDao"%>
<%@page import="br.com.Dao.UsuarioComercianteDao"%>
<%@page import="java.io.IOException"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Mercado Catalão</title>
        <!-- Bootstrap Core CSS -->
    <link href="bootstrap/css/bootstrap.css" rel="stylesheet">
    <script type="text/javascript" src="bootstrap/js/bootstrap.js"></script>
<style type="text/css">
.topo{
width:100%;
height:250px;
background-color: #eee;
margin-bottom: 20px;
margin-top: -20px;
}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}

</style>
</head>

<body>

<%
<<<<<<< .mine
//allow access only if session exists
=======
	//allow access only if session exists
>>>>>>> .r21
	String[] id= (String[]) session.getAttribute("user");
	UsuarioCliente userCliente = null;
	UsuarioComerciante userComerciante = null;
	UsuarioClienteDao dao = new UsuarioClienteDao();
	UsuarioComercianteDao dao1 = new UsuarioComercianteDao();
	if(id != null){
		out.print(id[0]+"->"+id[1]);
<<<<<<< .mine
		if(id[1].equals("1")){
		
			userCliente = dao.validaAutenticacaoUser(Long.parseLong(id[0]), Integer.parseInt(id[1]));
		
		}else{
			
			userComerciante = dao1.validaAutenticacaoUser(Long.parseLong(id[0]), Integer.parseInt(id[1]));
		}
	}
	String userName = null;
	String sessionID = null;
	Cookie[] cookies = request.getCookies();
	if(cookies !=null){
	for(Cookie cookie : cookies){
		if(cookie.getName().equals("user")) userName = cookie.getValue();
		if(cookie.getName().equals("JSESSIONID")) sessionID = cookie.getValue();
	}
=======
		if(id[1].equals("1")){
		
			userCliente = dao.validaAutenticacaoUser(Long.parseLong(id[0]), Integer.parseInt(id[1]));
		
		}else{
			
			userComerciante = dao1.validaAutenticacaoUser(Long.parseLong(id[0]), Integer.parseInt(id[1]));
		}
	}
	String userName = null;
	String sessionID = null;
	Cookie[] cookies = request.getCookies();
	if(cookies !=null){
	for(Cookie cookie : cookies){
		if(cookie.getName().equals("user")) userName = cookie.getValue();
		if(cookie.getName().equals("JSESSIONID")) sessionID = cookie.getValue();
	}
}
>>>>>>> .r21
<<<<<<< .mine
}
	if(userCliente != null || userComerciante != null){
		if(userCliente == null){
			out.print("Login : "+userComerciante.getLogin());
		}else{
			out.print("Login : "+userCliente.getLogin());			
		}
			
=======
	if(userCliente != null || userComerciante != null){
		if(userCliente == null){
			out.print("Login : "+userComerciante.getLogin());
		}else{
			out.print("Login : "+userCliente.getLogin());			
		}
			
>>>>>>> .r21
%>
<h3>Cokie Ola <%=userName %>, Login Efetuado sucesso. Session ID=<%=sessionID %></h3>
<% } %>
      

 <%@ include file="menu.jsp"%>

 <!-- cabeçalho -->
<div class="topo">
</div>



 <!-- estrutura -->
<div class="row">
  <div class="col-md-3" align="left">
  	<div class="panel panel-default">
 	 	<div class="panel-body">
 	 		Descriçao sobre a loja<br/><br/>
    		<address>
  			<strong>Twitter, Inc.</strong><br>
  				795 Folsom Ave, Suite 600<br>
  				San Francisco, CA 94107<br>
  			<span class="glyphicon glyphicon-earphone"></span>
  			<abbr title="Phone">P:</abbr> (123) 456-7890
			</address>
			<address>
  			<strong>Full Name</strong><br>
  			<a href="mailto:#">first.last@example.com</a>
			</address>
  		</div>
	</div>
</div>

  <div class="col-md-9">
  <div class="page-header">
  <h3>Produtos</h3>
  </div>
  <div class="col-md-3">
    <div class="thumbnail">
      <img src="img/logo.png" alt="..." />
      <div class="caption">
        <h4>Thumbnail label</h4>
        <p>...</p>
        <p><a href="#" class="btn btn-primary" role="button">Detalhes</a> <a href="#" class="btn btn-default" role="button">Loja</a></p>
      </div>
    </div>
  </div>
  
    <div class="col-md-3">
    <div class="thumbnail">
      <img src="img/logo.png" alt="..."/>
      <div class="caption">
        <h3>Thumbnail label</h3>
        <p>...</p>
        <p><a href="#" class="btn btn-primary" role="button">Button</a> <a href="#" class="btn btn-default" role="button">Button</a></p>
      </div>
    </div>
  </div>
  
    <div class="col-md-3">
    <div class="thumbnail">
      <img src="img/logo.png" alt="..."/>
      <div class="caption">
        <h3>Thumbnail label</h3>
        <p>...</p>
        <p><a href="#" class="btn btn-primary" role="button">Button</a> <a href="#" class="btn btn-default" role="button">Button</a></p>
      </div>
    </div>
  </div>
  
  <div class="col-md-3">
    <div class="thumbnail">
      <img src="img/logo.png" alt="..."/>
      <div class="caption">
        <h3>Thumbnail label</h3>
        <p>...</p>
        <p><a href="#" class="btn btn-primary" role="button">Button</a> <a href="#" class="btn btn-default" role="button">Button</a></p>
      </div>
    </div>
  </div>
  
      <div class="col-md-3">
    <div class="thumbnail">
      <img src="img/logo.png" alt="..."/>
      <div class="caption">
        <h3>Thumbnail label</h3>
        <p>...</p>
        <p><a href="#" class="btn btn-primary" role="button">Button</a> <a href="#" class="btn btn-default" role="button">Button</a></p>
      </div>
    </div>
  </div>
  
      <div class="col-md-3">
    <div class="thumbnail">
      <img src="img/logo.png" alt="..."/>
      <div class="caption">
        <h3>Thumbnail label</h3>
        <p>...</p>
        <p><a href="#" class="btn btn-primary" role="button">Button</a> <a href="#" class="btn btn-default" role="button">Button</a></p>
      </div>
    </div>
  </div>
  
      <div class="col-md-3">
    <div class="thumbnail">
      <img src="img/logo.png" alt="..."/>
      <div class="caption">
        <h3>Thumbnail label</h3>
        <p>...</p>
        <p><a href="#" class="btn btn-primary" role="button">Button</a> <a href="#" class="btn btn-default" role="button">Button</a></p>
      </div>
    </div>
  </div>
  
      <div class="col-md-3">
    <div class="thumbnail">
      <img src="img/logo.png" alt="..."/>
      <div class="caption">
        <h3>Thumbnail label</h3>
        <p>...</p>
        <p><a href="#" class="btn btn-primary" role="button">Button</a> <a href="#" class="btn btn-default" role="button">Button</a></p>
      </div>
    </div>
  </div>
  
</div>
  
</div>



</body>
</html>